﻿#ifndef REPORTGENERATOR_H
#define REPORTGENERATOR_H

#include <QWidget>
#include <QTableWidget>
#include <QAxObject>
#include <QDateTime>
#include "Common.h"

class ReportGenerator : public QWidget
{
    Q_OBJECT
public:
    explicit ReportGenerator(QWidget *parent = nullptr);
    ~ReportGenerator();
    QTableWidget *getTableWidgetPtr();
    //设置导出word文本信息
    void setWordInfo(const QStringList &infos);
    //表格数据设置
    void setData(const QJsonObject &obj);
    //设置当前点位
    void setCurPoint(const int &point);
public slots:
    void generateReport();
private slots:
    void loadData();
    void saveData();
private:
    void setupTable();
    bool generateWordReport(const QString &fileName);
private:
    QTableWidget *m_tableWidget;
    QStringList m_wordInfo;
    ReportInfo m_reportInfo;
    int m_curPoint = 0; //记录当前点位
};

#endif // REPORTGENERATOR_H
